import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Main',
    component: () => import('../views/tlias/MainView.vue'),
    children: [
      {
        path: 'chat',  // /chat 路由会展示聊天组件
        component: () => import('../views/tlias/ChatView.vue'),
      },
      {
        path: 'profiles',  // /chat 路由会展示聊天组件
        component: () => import('../views/tlias/ProfilesView.vue'),
      },
      {
        path: 'feedback',  // /chat 路由会展示聊天组件
        component: () => import('../views/tlias/FeedbackView.vue'),
      },
      // 可以继续添加其他的子路由
    ]
  },
  {
    path: '/login',
    name: 'LoginView',
    component: () => import('../views/tlias/LoginView.vue')
  },
  {
    path: '/register',
    name: 'RegisterView',
    component: () => import('../views/tlias/RegisterView.vue')
  },
  {
    path: '/admin',
    name: 'AdminView',
    component: () => import('../views/tlias/AdminView.vue'),
    children: [
      {
        path: 'feedbackHistory',  // /chat 路由会展示聊天组件
        component: () => import('../views/tlias/FeedbackHistoryView.vue'),
      },
      {
        path: 'manageAccounts',  // /chat 路由会展示聊天组件
        component: () => import('../views/tlias/ManageAccountsView.vue'),
      },
    ]

  },
]

const router = new VueRouter({
  routes
})

export default router